<?
require("config.php");

$location_status .= " | Edit";

$show_backnav = "color_menu";

$menuname = NULL;

$menutarget = NULL;

if (NULL!=$action){

   $field = array(
	"code", 
	"name", 
	"hex", 
	);


   $content = array(
	$Code,
	$Name,
	$Hex,
	);

   $expression = "id = $id";

   myUpdate($table,$field,$content,$expression);


   header("location:" . $rela_path . "share/msg.php?v=14");

}else{
	$Query = "select * from $table where id = $id";
	$r = myQuery($Query);

	if (!$r)header("location:" . $rela_path . "share/msg.php?v=9002");

	$Code = $r[0][1];
	$Name = $r[0][2];
	$Hex  = $r[0][3];

}

require($rela_path . "inc/header.php");

?>
<form action="" method="post" name="form1">
<table width="95%" border="0" align="center">
  <tr> 
    <td align="right">&nbsp; </td>
  </tr>
  <tr> 
    <td><table width="75%">
        <tr> 
          <td class="tdheader">Code :</td>
          <td><input type="text" class="text" name="Code" size="40" value=<?print($Code)?>> 
            <br> <input name="action" type="hidden" value="edit"> <input name="id" type="hidden" value="<?print($id)?>"> 
          </td>
        </tr>
        <tr> 
          <td class="tdheader">Name :</td>
          <td><input type="text" class="text" name="Name" size="40" value="<?print($Name)?>"></td>
        </tr>
        <tr> 
          <td class="tdheader">HEX# :</td>
          <td><input type="text" class="text" name="Hex" size="40" value="<?print($Hex)?>"></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('color_menu.php',1);return false;"> <input type="image" src="../../images/bt_save.gif">
          </td>
        </tr>
      </table>
      <p> <br>
        <br>
        <br>
        <br>
        <br>
        <br>
      </p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp; </p></td>
  </tr>
</table>
<?
require($rela_path . "inc/footer.php");
?>
